package com.javaspeak.algorithm.bubblesort.recursive;

import static org.junit.Assert.assertEquals;

import java.io.StringWriter;
import java.util.Arrays;

import org.junit.Test;
import org.junit.internal.TextListener;
import org.junit.runner.JUnitCore;

/**
 * @author John Dickerson
 */
public class RecursiveBubbleSortTest {

    @Test
    public void testBeRexursive(){

        String names[] = { "Bbb", "Aaa", "Ddd", "Eee", "Ccc" };
        String expected[] = { "Aaa", "Bbb", "Ccc", "Ddd", "Eee" };

        RecursiveBubbleSort.bubbleSort( 1, names, true );

        assertEquals( true, Arrays.equals( names, expected ) );
    }


    public static void main( String args[] ){

        JUnitCore junitCore = new JUnitCore();
        junitCore.addListener( new TextListener( System.out ) );
        junitCore.run( RecursiveBubbleSortTest.class );
    }
}
